<?php
    function LoadControl(){
        global $app_g,$mod_m,$method;
        $app_g  =   I('g');
        $mod_m    =   I('m');
        $method  =    I('a');
        if($app_g   ==null){
            $app_g  =   'Home';
        }
        if($mod_m   ==null){
            $mod_m  =   'Index';
        }
        if($method  ==  null){
            $method =   'index';
        }
    }
    function autoload($className){
        global $classMethod;
        if($classMethod ==  1){
            require_once APP_DIR.'/control/'.$className.'.control.php';
        }else{
            require_once ROOT_PATH.'/wisdom/include/'.$className.'.class.php';
        }
    }
    function M($tableName){
        global $classMethod;
        $classMethod    =   2;
        $db_mod  =   new Dbmysqli($tableName);
        return $db_mod;
    }
    function I($key){
        if($key){
            $GET    =   $_GET[$key];
            $POST   =   $_POST[$key];
            if($POST){
                return filter_var(addslashes($POST),FILTER_SANITIZE_STRING);
            }else{
                return filter_var(addslashes($GET),FILTER_SANITIZE_STRING);
            }
        }
        $GET   =   $_GET;
        $POST   =   $_POST;
        $data   =   array_merge($GET,$POST);
        foreach($data   as $key =>$v){
            $data[$key] =   filter_var(addslashes($v),FILTER_SANITIZE_STRING);
        }
        return $data;
    }
?>